# @Version  : 1.0
# @Author   : wgq
# @File     : practice01.py
# @Date     : 2025/6/11 12:35

# class Person:
#     name = '小蓝'
#     def speak(self):
#         print("大家好！,我是{}".format(self.name))
# person = Person()
# person.speak()
# person.name = 'tom'
# person.speak()
# class Person:
#     # name = ''
#     def __init__(self):
#         name = ''
#     def named(self,name):
#         self.name = name
#     def speak(self):
#         print("大家好！,我是{}".format(self.name))
# xiaolan = Person()
# xiaolan.named('小蓝')
# xiaowu = Person()
# xiaowu.named('小舞')
# xiaolan.speak()
# xiaowu.speak()
# class aa:
#     def __init__(self):
#         print("调用构造方法...")
#     def __del__(self):
#         print("调用析构方法...")
# aaa = aa()
# del aaa
# print("程序结束...")

# class Toy:
#     type = '小车'
#     def __init__(self,color):
#         self.color = color
#
# toy = Toy('红色')
# print(Toy.type,toy.color, toy.type)
# Toy.wheelNum = 4
# toy.price = 5
# print(Toy.wheelNum,toy.price,toy.wheelNum)
# print(Toy.color)

# class Toy:
#     color = '白色'
#     def __init__(self):
#         self.color = '红色'
# toy = Toy()
# print(Toy.color,toy.color)

class People:
    def __init__(self,age,name):
        self.__age = age
        self.name = name
    def __sayHello(self):
        print('大家好')
    def greet(self):
        self.__sayHello()
    def getAge(self):
        return self.__age
xiaolan = People('10','小蓝')
xiaolan.greet()
print('我叫{},我今年{}岁了'.format(xiaolan.name,xiaolan.getAge()))
# print(xiaolan._People_age
xiaolan._People_sayHello()